package model;

import java.awt.event.KeyEvent;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;


public class UserBar extends Bar
{
        private double coeff;
        private final double COEFF_D = 0.008;
        private final double COEFF_N = 0.01;
        private final double COEFF_A = 0.012;
        
        public UserBar()
        {
                super();
                
                try{
                        image = ImageIO.read(new File("UserBarDefault.png"));
                } catch(IOException e){ 
                }
        }
        
        public UserBar(String filename)
        {
                super();
                
                try{
                        image = ImageIO.read(new File(filename));
                } catch(IOException e){ 
                }
        }
        
        public void setCoeff(int state)
        {
                if(state < 0)
                        coeff = COEFF_D;
                else if(state > 0)
                        coeff = COEFF_A;
                else
                        coeff = COEFF_N;
        }
        
        public double getCoeff()
        {
                return coeff;
        }
        
}